package io.awen.modules.sign.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.awen.common.utils.PageUtils;
import io.awen.modules.sign.entity.SignContainerEntity;
import io.awen.modules.sign.entity.SignSinkEntity;
import io.awen.modules.sign.qo.SignSinkQo;

import java.util.Date;
import java.util.Map;

/**
 * 容器信息表
 *
 * @author liu.wen
 * @email liu.wen@qq.com
 * @date 2022-08-10 00:47:08
 */
public interface SignSinkService extends IService<SignSinkEntity> {

    /**
     * 通过 sensorId 在内存中获取对应容器
     * @param sensorId
     * @return
     */
    SignSinkEntity findSink(String sensorId);

    SignSinkEntity findSink(Long id);

    SignSinkEntity findAllSink(Long id);

    /**
     * 更新容器液位值
     * @param sensorId
     * @param value
     */
    void updateSensorValue(String sensorId, Double value, Date dataTime);

    /**
     * 分页查询
     * @param qo
     * @return
     */
    PageUtils queryPage(SignSinkQo qo);

    void saveAndCache(SignSinkEntity signSink);

    void updateAndCache(SignSinkEntity signSink);

    int total(SignSinkQo qo);

    Map<String, SignSinkEntity> getSensorSinkMap();

    SignSinkEntity getBySensorId(String sensorId);


}

